<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_bills', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id');
            $table->date('bill_date')->nullable();
            $table->decimal('total_amount', 10, 2);
            $table->text('content')->nullable();
            $table->enum('status', ['pending', 'approved', 'rejected'])->default('pending');
            $table->timestamps();
        });

        // 劳务工时记录表
        Schema::create('user_hours', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('labor_contract_id');
            $table->date('work_date')->nullable();
            $table->integer('hours_worked')->nullable();
            $table->text('work_description')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_bills');
        Schema::dropIfExists('user_hours');
    }
};
